package com.huawei.classroom.student.h15;

public class ThreadUtil extends Thread{
	private StringBuffer buf;
	public ThreadUtil(StringBuffer buf) {
		this.buf = buf;//StringBuffer是引用传递
	}
	
	public void run() {
		try {
			sleep(500);//睡眠500ms后再赋值ok
			buf.append("ok");
		}catch(InterruptedException e) {
			throw new RuntimeException(e);
		}
	}
}
